package cn.edu.qzuie.artist.module.td.dal.mysql.major;

import java.util.*;

import cn.edu.qzuie.artist.framework.common.pojo.PageResult;
import cn.edu.qzuie.artist.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.edu.qzuie.artist.framework.mybatis.core.mapper.BaseMapperX;
import cn.edu.qzuie.artist.module.td.dal.dataobject.major.MajorDO;
import org.apache.ibatis.annotations.Mapper;
import cn.edu.qzuie.artist.module.td.controller.admin.major.vo.*;

/**
 * 专业 Mapper
 *
 * @author 泉信管理员
 */
@Mapper
public interface MajorMapper extends BaseMapperX<MajorDO> {

    default PageResult<MajorDO> selectPage(MajorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<MajorDO>()
                .eqIfPresent(MajorDO::getDepartId, reqVO.getDepartId())
                .likeIfPresent(MajorDO::getMajorName, reqVO.getMajorName())
                .orderByAsc(MajorDO::getId));
    }

}